Method and system for processing an image extracted from a document

ABSTRACT

The present disclosure relates to a method and system for processing an image extracted from a document. The image processing system detects one or more edges of the image and determines a missing edge in the image by comparing color gradients of the edges. The missing edges are recreated by cloning image pixels based on data pixels of an edge, opposite to the missing edge, amongst the one or more edges to obtain a reconstructed image. Outer corner points in the reconstructed image are identified based on quadratic corner points, wherein the quadratic corner points are determined based on the one or more edges and the reconstructed edge. Further, the image processing system performs an image perspective correction on the reconstructed image, based on the outer corner points, to obtain a processed image.

TECHNICAL FIELD

The present subject matter is related, in general to image processing,and more particularly, but not exclusively to a method and system forprocessing an image extracted from a document.

BACKGROUND

Image processing is a method of converting an image into digital formand performing some operations on it, in order to get an enhanced imageor to extract some useful information from the image. Image processingis a type of signal dispensation in which, input is an image or aphotograph and output may be an enhanced image or characteristicsassociated with the input image. Usually image processing system treatsimages as two dimensional objects while applying already set imageprocessing methods onto them.

Generally, servers and/or computing systems present in service domainssuch as banks, mobile service providers, and governmentagencies/authorities find it very difficult to detect and retrieverequired information from a faulty image, such as a photograph of agovernment issued identification card, received from a user. In suchcases, a manual verification of the faulty images is performed toretrieve the required information and to input the information to theconcerned servers and/or computing systems. However, the manualverification of the images is time consuming and the retrievedinformation is prone to human errors. Hence, there is a need forcorrecting and processing the faulty images before sending the imagesfor automatic retrieval of information.

The conventional techniques for correcting and processing a faulty imageperform visual inspection of the faulty images for comparing the currentimages taken in real-time with a set of old images to assess change inthe object. However, the conditions under which the current images areacquired affect the ability to obtain an accurate comparison.Specifically, such methods of assessing an image do not take intoconsideration, the factors such as image alignment, missingareas/edges/corners in the image, and color and texture of the image andits background which may lead to inaccuracies.

The issues typically faced in processing an image are detecting boundaryof the image when background of the image and the captured image havesimilar color and texture, and identifying a missing edge and/or cornersin the captured image.

SUMMARY

Disclosed herein is a method and system for processing an imageextracted from a document. In order to process the image extracted fromthe document, it is required that the image processing system is able toidentify and correct noisy, corrupt and unclear parts on the image. Theimage processing method used herein performs various techniques, suchas, image preprocessing, missing edge detection and perspective imagecorrection for processing the image extracted from the document.

Accordingly, the present disclosure relates to a method for processingan image extracted from a document. The method comprises detecting, byan image processing system, one or more edges of the extracted image.The image processing system determines a missing edge in the image bycomparing color gradients of the one or more edges of the image. Themissing edge is reconstructed by cloning image pixels based on datapixels of an edge, opposite to the missing edge, amongst the one or moreedges to obtain a reconstructed image. Further, the image processingsystem identifies outer corner points in the reconstructed image basedon quadratic corner points, wherein the quadratic corner points aredetermined based on the one or more edges and the reconstructed edge. Animage perspective correction is performed on the reconstructed image,based on the outer corner points, to obtain a processed image.

Further, the present disclosure relates to an image processing systemfor processing an image extracted from a document. The image processingsystem detects one or more edges of the image. A missing edge isdetermined in the image by comparing colour gradients of the one or moreedges. The determined missing edge is reconstructed by cloning imagepixels based on data pixels of an edge, opposite to the missing edge,amongst the one or more edges to obtain a reconstructed image, whereinthe reconstructed image includes a reconstructed edge. The imageprocessing system further comprises identifying outer corner points inthe reconstructed image based on quadratic corner points, wherein thequadratic corner points are determined based on the one or more edgesand the reconstructed edge. An image perspective correction is performedon the reconstructed image, based on the outer corner points, to obtaina processed image.

Furthermore, the present disclosure relates to a non-transitory computerreadable medium including instructions stored thereon that whenprocessed by at least one processor causes an image processing system toperform the acts of detecting one or more edges of the image. Theinstructions further cause the image processing system to determine amissing edge in the image by comparing colour gradients of the one ormore edges. The missing edge of the image is reconstructed by cloningimage pixels based on data pixels of an edge, opposite to the missingedge, amongst the one or more edges to obtain a reconstructed image,wherein the reconstructed image includes a reconstructed edge. Theinstructions further cause the image processing system to identify outercorner points in the reconstructed image based on quadratic cornerpoints, wherein the quadratic corner points are determined based on theone or more edges and the reconstructed edge. An image perspectivecorrection on the reconstructed image is performed based on the outercorner points, to obtain a processed image.

The foregoing summary is illustrative only and is not intended to be inany way limiting. In addition to the illustrative aspects, embodiments,and features described above, further aspects, embodiments, and featureswill become apparent by reference to the drawings and the followingdetailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this disclosure, illustrate exemplary embodiments and, togetherwith the description, serve to explain the disclosed principles. In thefigures, the left-most digit(s) of a reference number identifies thefigure in which the reference number first appears. The same numbers areused throughout the figures to reference like features and components.Some embodiments of system and/or methods in accordance with embodimentsof the present subject matter are now described, by way of example only,and with reference to the accompanying figures, in which:

FIG. 1 shows an exemplary environment for processing an image extractedfrom a document in accordance with some embodiments of the presentdisclosure;

FIG. 2 shows a detailed block diagram illustrating an image processingsystem in accordance with some embodiments of the present disclosure;

FIG. 3a to 3c show various steps involved in processing an imageextracted from a document in accordance with some embodiments of thepresent disclosure;

FIG. 3d illustrates a flowchart showing a method for processing an imageextracted from a document in accordance with an exemplary embodiment ofthe present disclosure; and

FIG. 4 illustrates a block diagram of an exemplary computer system forimplementing embodiments consistent with the present disclosure.

It should be appreciated by those skilled in the art that any blockdiagrams herein represent conceptual views of illustrative systemsembodying the principles of the present subject matter. Similarly, itwill be appreciated that any flow charts, flow diagrams, statetransition diagrams, pseudo code, and the like represent variousprocesses which may be substantially represented in computer readablemedium and executed by a computer or processor, whether or not suchcomputer or processor is explicitly shown.

DETAILED DESCRIPTION

In the present document, the word “exemplary” is used herein to mean“serving as an example, instance, or illustration.” Any embodiment orimplementation of the present subject matter described herein as“exemplary” is not necessarily to be construed as preferred oradvantageous over other embodiments.

While the disclosure is susceptible to various modifications andalternative forms, specific embodiment thereof has been shown by way ofexample in the drawings and will be described in detail below. It shouldbe understood, however that it is not intended to limit the disclosureto the particular forms disclosed, but on the contrary, the disclosureis to cover all modifications, equivalents, and alternative fallingwithin the spirit and the scope of the disclosure.

The terms “comprises”, “comprising”, or any other variations thereof,are intended to cover a non-exclusive inclusion, such that a setup,device or method that comprises a list of components or steps does notinclude only those components or steps but may include other componentsor steps not expressly listed or inherent to such setup or device ormethod. In other words, one or more elements in a system or apparatusproceeded by “comprises . . . a” does not, without more constraints,preclude the existence of other elements or additional elements in thesystem or method.

The present disclosure relates to a method and system for processing animage extracted from a document. The image processing system detects oneor more edges of the image and determines a missing edge in the image bycomparing color gradients of the edges. The missing edges are recreatedby cloning image pixels based on data pixels of an edge, opposite to themissing edge, amongst the one or more edges to obtain a reconstructedimage. Outer corner points in the reconstructed image are identifiedbased on quadratic corner points, wherein the quadratic corner pointsare determined based on the one or more edges and the reconstructededge. Further, the image processing system performs an image perspectivecorrection on the reconstructed image, based on the outer corner points,to obtain a processed image.

In the following detailed description of the embodiments of thedisclosure, reference is made to the accompanying drawings that form apart hereof, and in which are shown by way of illustration specificembodiments in which the disclosure may be practiced. These embodimentsare described in sufficient detail to enable those skilled in the art topractice the disclosure, and it is to be understood that otherembodiments may be utilized and that changes may be made withoutdeparting from the scope of the present disclosure. The followingdescription is, therefore, not to be taken in a limiting sense.

FIG. 1 shows an exemplary environment for processing an image extractedfrom a document in accordance with some embodiments of the presentdisclosure.

The environment 100 comprises an image processing system 101 forprocessing an image extracted from a document 109. The image processingsystem 101 comprises a processor 105 to perform one or more imageprocessing operations on the one or more images extracted from thedocument 109. In an embodiment, the extracted image 203 is atwo-dimensional entity, such as a photograph or a screen display. Thedocument 109 may comprise one or more scanned copies of images, such as,a scanned identity card. In an embodiment, the document 109 may be anoptical document comprising one or more images captured from one or moreoptical devices such as cameras, mirrors, lenses, telescopes,microscopes, etc., and one or more digital images. In an embodiment, theimage processing system 101 contains various image processing modules202 (Shown in FIG. 2) to process the extracted image 203, therebyenabling easy identification and retrieval of required information fromthe extracted image 203.

FIG. 2 shows a detailed block diagram illustrating an image processingsystem in accordance with some embodiments of the present disclosure.

In an embodiment, the image processing system 101 comprises an I/Ointerface 103, a memory 107 and the processor 105. The I/O interface 103is configured to extract one or more images from the document 109. Theextracted image 203 may comprise one or more defects which need to becorrected by the image processing system 101. The memory 107 iscommunicatively coupled to the processor 105 and stores the extractedimage 203. The processor 105 performs one or more image processingoperations on the extracted image 203 using the one or more modules 202.

In an embodiment, the memory 107 may include one or more data 200,including reconstructed image 205, trained data image set 207 and otherdata 209 along with the extracted image 203. In an embodiment, the data200 may be stored in the memory 107 in the form of various datastructures. Additionally, the aforementioned data 200 can be organizedusing data models, such as relational or hierarchical data models. Theother data 209 may store data, including temporary data and temporaryfiles, generated by modules 202 for performing the various functions ofthe image processing system 101.

In an embodiment, the extracted image 203 may include, withoutlimitation, digital photographs, image of the captured identity card andthe similar. The extracted image 203 is the image that needs to becorrected and processed by the image processing system 101. As anexample, when a user captures the image of an identity card, any oneside of the identity card may be cropped in the captured image. Also,the captured image may comprise skew, distortion and one or more otherdisorders which need to be corrected by the image processing system 101.

In an embodiment, the reconstructed image 205 is obtained byreconstructing the one or more missing edges of the extracted image 203using one or more image reconstruction techniques. As an example, one ofthe one or more image reconstruction techniques includes cloning one ormore image pixels based on data pixels of an edge, opposite to themissing edge, amongst the one or more other edges of the image. Thecloning of one or more image pixels is performed to obtain areconstructed image 205, wherein the reconstructed image 205 includesone or more reconstructed edges.

In an embodiment, the trained data image set 207 of the reconstructedimage 205 is generated by extracting at least one of one or more uniquefeatures from the reconstructed image 205. As an example, the one ormore unique features of an image may include, but not limited to, aunique identification number, position of the identification numberand/or photographs in the captured image of the identity card. Further,the extracted trained data image set 207 may be compared with one ormore predefined trained data image sets 207 for validating thereconstructed image 205. As an example, the one or more predefinedtrained data image sets 207 may include, but not limited to, one or moretemplate images and their related features. Furthermore, upon successfulvalidation, the reconstructed images 205 may be stored in the memory 107for future validation of other images.

In an embodiment, the data 200 stored in the memory 107 are processed bythe modules 202 of the image processing system 101. The modules 202 maybe stored within the memory 107 as shown in FIG. 2. In an example, themodules 202 are communicatively coupled to the processor 105. In anotherembodiment, the module 202 may also be present outside the memory 107.

In one implementation, the modules 202 may include, for example, areceiving module 211, pre-processing module 213, reconstruction module215, correction module 217 and other modules 219. The other modules 219may be used to perform various miscellaneous functionalities of theimage processing system 101. It will be appreciated that suchaforementioned modules 202 may be represented as a single module or acombination of different modules.

In an embodiment, the receiving module 211 is configured to receive oneor more extracted image 203 from the document 109. The receiving module211 may also be configured to receive one or more inputs from the userthrough the I/O interface 103. As an example, the one or more inputsreceived from the user may include, the predefined trained image sets,and the threshold offset values and other configuration details.

FIG. 3a to 3c show various steps involved in processing an imageextracted from the document 109 in accordance with some embodiments ofthe present disclosure using one or more modules 202 of the imageprocessing system 101.

In an embodiment, at step 301 of FIG. 3a , the pre-processing module 213resizes the extracted image 203 to a predetermined standard size. As anexample, the predetermined standard size for resizing may be 8″×10″, 300ppi or 3000×2400 pixels. Upon resizing, the pre-processing module 213performs de-blurring of the image, at step 303, to reduce noise in theextracted image 203. A line detection algorithm, such as, Canny & Houghlines crossing algorithm may be used to detect and derive one or morelines and/or axes passing through the plane of the resized image asshown in step 305. In an embodiment, the one or more lines detected bythe lines crossing algorithm are sorted in the memory 107 and one ormore duplicate lines are eliminated from the image.

In an embodiment, at step 307, the reconstruction module 215 extends allthe derived lines along one or more missing edges to detect one or moreintersecting lines and corresponding points of intersections. At step309, the reconstruction module 215 filters each of the extended lines todetect and eliminate one or more duplicate lines in the extracted image203. Further, the reconstruction module 215 captures the one or moreintersecting points in an array stored in the memory 107 to determinethe number of outer corner points in the image. In an embodiment, atstep 313, the resized image is validated to check if there are only fourouter corner points for an ideal case scenario i.e., a two-dimensionalimage having four outer corner points. If there are only four outercorner points in the resized image, then the image is passed to theimage correction module 217 as shown in step 321.

In an embodiment, if there are more quadratic corner points in theimage, each of the one or more corner points is filtered to eliminateredundant quadratic corner points. At step 315, the outer corner pointsof the image are detected based on coordinates along a verticaldirection and a horizontal direction corresponding to each of thequadratic corner point present in the filtered set of quadratic cornerpoints. At step 317, the reconstruction module 215 validates each of thedetected outer corner points. Upon failing to detect all the outercornet points of the image, a predetermined edge detection filterthreshold offset associated with the filtering process is increaseduntil all the outer corner points of the image are detected as shown instep 319. As an example, the predetermined edge detection filterthreshold offset may comprise a maximum value of X and Y, minimum valueof X and Y, top most right side X and Y, top most left side X and Y,bottom most right side X and Y, bottom most left side X and Y. Wherein Xand Y represent the corresponding corner points on the X coordinate axisand Y coordinate axis respectively. Further, upon successful validationof the outer corner points at step 317, the reconstructed image 205 ispassed on to the image correction module 217.

In an embodiment, if one or more edges of the image are missing and/orhave been cropped from the image, the reconstruction module 215 detectsand reconstructs the missing and/or cropped sides of the image. Thereconstruction of the missing edges includes detecting the region ofimage over all four sides of the image as shown in step 341 of FIG. 3b .Further, at step 343, the reconstruction module 215 computes an averagecolor value on region of the image over all four edges. At step 345, amissing and/or cropped edge is detected when the average color value atany one of the edge is not matching with the average color value at theother three edges of the image. Further, at step 349, a pixeltransformation algorithm, such as affine transformation, may be used toregenerate the missing part of the image. The pixel transformation movesall the pixels diagonally by half the size of the predetermined offsetvalue on both X and Y coordinates, such that the image will be movedover an extended boundary diagonally. In other words, all the pixels aremoved such that there is a diagonal shift in the image. At step 351, oneor more opposite sides of a missing and/or cropped edge is cloned untila predetermined offset threshold is reached. Furthermore, at step 353, avariation in the color of the extended image and the background of theimage is computed. This introduces a color edge intensity direction inthe reconstructed image 205. This process is repeated on all four edgesof the image, thereby forming a complete image.

In an embodiment, respective background boundary of the image may becloned by the nearby pixels to form a refined image boundary. Thereconstruction module 215 also computes a variation in the color betweenthe background of the image and the body of the image to introduce acolor edge intensity direction in the reconstructed image 205.

In an embodiment, at step 361 of FIG. 3c , the image correction module217 detects an approximate polygon on the detected outer corner pointsand the reconstructed edges. At step 363, the image correction module217 also determines the center of mass of the reconstructed image 205 onthe determined approximate polygon. Further, at step 365, a perspectivetransformation for the reconstructed image 205 is computed using thecenter of mass and the standard image size. At step 367, the correctionmodule 217 performs a wrap perspective transformation on thereconstructed image 205 using the predetermined threshold offset asdiscussed in the reconstruction module 215.

FIG. 3d illustrates a flowchart showing method for processing an imageextracted from a document in accordance with an exemplary embodiment ofthe present disclosure.

As illustrated in FIG. 3d , the method 300 comprises one or more blocksfor processing an image using the image processing system 101. Themethod 300 may be described in the general context of computerexecutable instructions. Generally, computer executable instructions caninclude routines, programs, objects, components, data structures,procedures, modules, and functions, which perform particular functionsor implement particular abstract data types.

The order in which the method 300 is described is not intended to beconstrued as a limitation, and any number of the described method blockscan be combined in any order to implement the method. Additionally,individual blocks may be deleted from the methods without departing fromthe spirit and scope of the subject matter described herein.Furthermore, the method can be implemented in any suitable hardware,software, firmware, or combination thereof.

At block 381, the image processing system 101 detects one or more edgesof the image extracted from a document 109. The document 109 maycomprise one or more scanned copies of images, such as, a scannedidentity card. The extracted image 203 may comprise one or moredistortions which need to be processed and eliminated by the imageprocessing system 101.

At block 383, the image processing system 101 determines a missing edgein the image by comparing color gradients of the one or more edges. Themissing edges are determined by computing a color gradient along eachside of the image and comparing the color gradient of each side withremaining sides.

At block 385, the image processing system 101 reconstructs the missingedge by cloning image pixels based on data pixels of an edge, oppositeto the missing edge, amongst the one or more edges to obtain areconstructed image 205, wherein the reconstructed image 205 includes areconstructed edge. The size of the image is extended along the missingedge until a predetermined offset is reached to obtain an extendedimage. An empty region is determined in the extended image by movingdata pixels based on the predetermined offset. Further, the determinedempty region is cloned based on the data pixel of the edge opposite tothe missing edge, to reconstruct the missing edge.

At block 387, the image processing system 101 identifies outer cornerpoints in the reconstructed image 205 based on quadratic corner points,wherein the quadratic corner points are determined based on the one ormore edges and the reconstructed edge. The quadratic corner points arederived by extending lines detected along the one or more missing edgesand the reconstructed edge. The redundant quadratic corner pointsamongst the quadratic corner points are filtered to obtain a filteredset of quadratic corner points. Outer corner points in the filtered setof quadratic corner points are detected based on coordinates, along avertical direction and a horizontal direction, corresponding to eachquadratic corner point present in the filtered set of quadratic cornerpoints. An edge detection filter threshold value of the reconstructedimage 205 may be increased upon unsuccessful detection of all the outercorner points. Further, the process of detecting the outer corner pointsis iterated with the increased edge detection filter threshold valuetill all the outer corner points are detected.

At block 389, the image processing system 101 performs an imageperspective correction on the reconstructed image 205, based on theouter corner points, to obtain a processed image. Performing the imageperspective correction includes performing polygon approximation on theouter corner points. A mass center of the reconstructed image 205 isdetermined based on the polygon approximation. A perspectivetransformation for the reconstructed image 205 is computed based on themass center and a predefined image size. Further, the computedperspective transformation is applied to the reconstructed image 205 toobtain the processed image.

Computer System

FIG. 4 illustrates a block diagram of an exemplary computer system 400for implementing embodiments consistent with the present invention. Inan embodiment, the computer system 400 is used for processing an imageextracted from a document 109 using an image processing system 101. Thecomputer system 400 may comprise a central processing unit (“CPU” or“processor”) 402. The processor 402 may comprise at least one dataprocessor for executing program components for executing user- orsystem-generated business processes. A user may include a person, aperson using a device such as such as those included in this invention,or such a device itself. The processor 402 may include specializedprocessing units such as integrated system (bus) controllers, memorymanagement control units, floating point units, graphics processingunits, digital signal processing units, etc.

The processor 402 may be disposed in communication with one or moreinput/output (I/O) devices (411 and 412) via I/O interface 401. The I/Ointerface 401 may employ communication protocols/methods such as,without limitation, audio, analog, digital, stereo, IEEE-1394, serialbus, Universal Serial Bus (USB), infrared, PS/2, BNC, coaxial,component, composite, Digital Visual Interface (DVI), high-definitionmultimedia interface (HDMI), Radio Frequency (RF) antennas, S-Video,Video Graphics Array (VGA), IEEE 802.n/b/g/n/x, Bluetooth, cellular(e.g., Code-Division Multiple Access (CDMA), High-Speed Packet Access(HSPA+), Global System For Mobile Communications (GSM), Long-TermEvolution (LTE), WiMax, or the like), etc.

Using the I/O interface 401, the computer system 400 may communicatewith one or more I/O devices (411 and 412).

In some embodiments, the processor 402 may be disposed in communicationwith a communication network 409 via a network interface 403. Thenetwork interface 403 may communicate with the communication network409. The network interface 403 may employ connection protocolsincluding, without limitation, direct connect, Ethernet (e.g., twistedpair 10/100/1000 Base T), Transmission Control Protocol/InternetProtocol (TCP/IP), token ring, IEEE 802.11a/b/g/n/x, etc. Using thenetwork interface 403 and the communication network 409, the computersystem 400 may communicate with one or more user devices 410 (a, . . . ,n). The communication network 409 can be implemented as one of thedifferent types of networks, such as intranet or Local Area Network(LAN) and such within the organization. The communication network 409may either be a dedicated network or a shared network, which representsan association of the different types of networks that use a variety ofprotocols, for example, Hypertext Transfer Protocol (HTTP), TransmissionControl Protocol/Internet Protocol (TCP/IP), Wireless ApplicationProtocol (WAP), etc., to communicate with each other. Further, thecommunication network 409 may include a variety of network devices,including routers, bridges, servers, computing devices, storage devices,etc. The one or more user devices 410 (a, . . . , n) may include,without limitation, personal computer(s), mobile devices such ascellular telephones, smartphones, tablet computers, eBook readers,laptop computers, notebooks, gaming consoles, or the like.

In some embodiments, the processor 402 may be disposed in communicationwith a memory 405 (e.g., RAM, ROM, etc. not shown in FIG. 4) via astorage interface 404. The storage interface 404 may connect to memory405 including, without limitation, memory drives, removable disc drives,etc., employing connection protocols such as Serial Advanced TechnologyAttachment (SATA), Integrated Drive Electronics (IDE), IEEE-1394,Universal Serial Bus (USB), fiber channel, Small Computer SystemsInterface (SCSI), etc. The memory drives may further include a drum,magnetic disc drive, magneto-optical drive, optical drive, RedundantArray of Independent Discs (RAID), solid-state memory devices,solid-state drives, etc.

The memory 405 may store a collection of program or database components,including, without limitation, user interface application 406, anoperating system 407, web server 408 etc. In some embodiments, computersystem 400 may store user/application data 406, such as the data,variables, records, etc. as described in this invention. Such databasesmay be implemented as fault-tolerant, relational, scalable, securedatabases such as Oracle or Sybase.

The operating system 407 may facilitate resource management andoperation of the computer system 400. Examples of operating systemsinclude, without limitation, Apple Macintosh OS X, UNIX, Unix-likesystem distributions (e.g., Berkeley Software Distribution (BSD),FreeBSD, NetBSD, OpenBSD, etc.), Linux distributions (e.g., Red Hat,Ubuntu, Kubuntu, etc.), International Business Machines (IBM) OS/2,Microsoft Windows (XP, Vista/7/8, etc.), Apple iOS, Google Android,Blackberry Operating System (OS), or the like. User interface 406 mayfacilitate display, execution, interaction, manipulation, or operationof program components through textual or graphical facilities. Forexample, user interfaces may provide computer interaction interfaceelements on a display system operatively connected to the computersystem 400, such as cursors, icons, check boxes, menus, scrollers,windows, widgets, etc. Graphical User Interfaces (GUIs) may be employed,including, without limitation, Apple Macintosh operating systems' Aqua,IBM OS/2, Microsoft Windows (e.g., Aero, Metro, etc.), Unix X-Windows,web interface libraries (e.g., ActiveX, Java, Javascript, AJAX, HTML,Adobe Flash, etc.), or the like.

In some embodiments, the computer system 400 may implement a web browser408 stored program component. The web browser may be a hypertext viewingapplication, such as Microsoft Internet Explorer, Google Chrome, MozillaFirefox, Apple Safari, etc. Secure web browsing may be provided usingSecure Hypertext Transport Protocol (HTTPS) secure sockets layer (SSL),Transport Layer Security (TLS), etc. Web browsers may utilize facilitiessuch as AJAX, DHTML, Adobe Flash, JavaScript, Java, ApplicationProgramming Interfaces (APIs), etc. In some embodiments, the computersystem 400 may implement a mail server stored program component. Themail server may be an Internet mail server such as Microsoft Exchange,or the like. The mail server may utilize facilities such as ActiveServer Pages (ASP), ActiveX, American National Standards Institute(ANSI) C++/C#, Microsoft .NET, CGI scripts, Java, JavaScript, PERL, PHP,Python, WebObjects, etc. The mail server may utilize communicationprotocols such as Internet Message Access Protocol (IMAP), MessagingApplication Programming Interface (MAPI), Microsoft Exchange, PostOffice Protocol (POP), Simple Mail Transfer Protocol (SMTP), or thelike. In some embodiments, the computer system 400 may implement a mailclient stored program component. The mail client may be a mail viewingapplication, such as Apple Mail, Microsoft Entourage, Microsoft Outlook,Mozilla Thunderbird, etc.

Furthermore, one or more computer-readable storage media may be utilizedin implementing embodiments consistent with the present invention. Acomputer-readable storage medium refers to any type of physical memoryon which information or data readable by a processor may be stored.Thus, a computer-readable storage medium may store instructions forexecution by one or more processors, including instructions for causingthe processor(s) to perform steps or stages consistent with theembodiments described herein. The term “computer-readable medium” shouldbe understood to include tangible items and exclude carrier waves andtransient signals, i.e., non-transitory. Examples include Random AccessMemory (RAM), Read-Only Memory (ROM), volatile memory, nonvolatilememory, hard drives, Compact Disc (CD) ROMs, Digital Video Disc (DVDs),flash drives, disks, and any other known physical storage media.

Advantages of the Embodiment of the Present Disclosure are IllustratedHerein

In an embodiment, the present disclosure provides a method toautomatically detect and correct skew, distortion and perspective errorsin a faulty image.

In an embodiment, the present disclosure provides a method to detect andreconstruct the missing edges of an image, irrespective of background,texture and color of the image.

In an embodiment, the method of the present disclosure eliminates theneed for manual verification of the faulty images for retrieving one ormore essential information from the image, thereby reducing the manhours and/or efforts required for the same.

The terms “an embodiment”, “embodiment”, “embodiments”, “theembodiment”, “the embodiments”, “one or more embodiments”, “someembodiments”, and “one embodiment” mean “one or more (but not all)embodiments of the invention(s)” unless expressly specified otherwise.

The terms “including”, “comprising”, “having” and variations thereofmean “including but not limited to”, unless expressly specifiedotherwise.

The enumerated listing of items does not imply that any or all of theitems are mutually exclusive, unless expressly specified otherwise.

The terms “a”, “an” and “the” mean “one or more”, unless expresslyspecified otherwise.

A description of an embodiment with several components in communicationwith each other does not imply that all such components are required. Onthe contrary a variety of optional components are described toillustrate the wide variety of possible embodiments of the invention.

When a single device or article is described herein, it will be readilyapparent that more than one device/article (whether or not theycooperate) may be used in place of a single device/article. Similarly,where more than one device or article is described herein (whether ornot they cooperate), it will be readily apparent that a singledevice/article may be used in place of the more than one device orarticle or a different number of devices/articles may be used instead ofthe shown number of devices or programs. The functionality and/or thefeatures of a device may be alternatively embodied by one or more otherdevices which are not explicitly described as having suchfunctionality/features. Thus, other embodiments of the invention neednot include the device itself.

Finally, the language used in the specification has been principallyselected for readability and instructional purposes, and it may not havebeen selected to delineate or circumscribe the inventive subject matter.It is therefore intended that the scope of the invention be limited notby this detailed description, but rather by any claims that issue on anapplication based here on. Accordingly, the embodiments of the presentinvention are intended to be illustrative, but not limiting, of thescope of the invention, which is set forth in the following claims.

While various aspects and embodiments have been disclosed herein, otheraspects and embodiments will be apparent to those skilled in the art.The various aspects and embodiments disclosed herein are for purposes ofillustration and are not intended to be limiting, with the true scopeand spirit being indicated by the following claims.

Referral Numerals: Reference Number Description 100 Environment 101Image processing system 103 I/O interface 105 Processor 107 Memory 109Document 200 Data 202 Modules 203 Extracted image 205 Reconstructedimage 207 Trained data image set 209 Other data 211 Receiving module 213Pre-processing module 215 Reconstruction module 217 Correction module219 Other modules

What is claimed is:
 1. A method for processing an image extracted from adocument, the method comprising: detecting, by an image processingsystem, one or more edges of the image; determining, by the imageprocessing system, a missing edge in the image by comparing colorgradients of the one or more edges; computing a color gradient alongeach side of the image; and comparing the color gradient of each sidewith remaining sides to detect the missing edge; reconstructing, by theimage processing system, the missing edge by cloning image pixels basedon data pixels of an edge, opposite to the missing edge, amongst the oneor more edges to obtain a reconstructed image, wherein the reconstructedimage includes a reconstructed edge; identifying, by the imageprocessing system, outer corner points in the reconstructed image basedon quadratic corner points, wherein the quadratic corner points aredetermined based on the one or more edges and the reconstructed edge;and performing, by the image processing system, an image perspectivecorrection on the reconstructed image, based on the outer corner points,to obtain a processed image.
 2. The method as claimed in claim 1 furthercomprises: extracting, by the image processing system, at least oneunique feature from the processed image; comparing, by the imageprocessing system, the at least one unique feature with a trained dataset to validate the processed image, wherein the trained data setcomprises template images and predefined features set; and storing, bythe image processing system, the processed image for future usage uponsuccessful validation.
 3. The method as claimed in claim 1, whereinreconstructing the missing edge further comprises: extending size of theimage along the missing edge until a predetermined offset is reached toobtain an extended image; determining an empty region in the extendedimage by moving data pixels based on the predetermined offset; andcloning the empty region, based on the data pixel of the edge oppositeto the missing edge, to reconstruct the missing edge.
 4. The method asclaimed in claim 3, wherein cloning the empty region further comprises:computing a color variation between background color and a color of thedocument; and applying an edge gradient direction on cloned emptyregion, wherein the edge image gradient direction is determined based onthe color variation.
 5. The method as claimed in claim 1, whereinidentifying the outer corner points further comprises: deriving thequadratic corner points by extending lines detected along the one ormore missing edges and the reconstructed edge; filtering redundantquadratic corner points amongst the quadratic corner points to obtain afiltered set of quadratic corner points; detecting outer corner pointsin the filtered set of quadratic corner points based on coordinates,along a vertical direction and a horizontal direction, corresponding toeach quadratic corner point present in the filtered set of quadraticcorner points; increasing an edge detection filter threshold value ofthe reconstructed image upon unsuccessful detection of all the outercorner points; and iterating detection of the outer corner points withthe increased edge detection filter threshold value till all the outercorner points are detected.
 6. The method as claimed in claim 1, whereinperforming the image perspective correction on the reconstructed imagefurther comprises: performing polygon approximation on the outer cornerpoints; determining a mass center of the reconstructed image based onthe polygon approximation; computing a perspective transformation forthe reconstructed image based on the mass center and a predefined imagesize; and applying the perspective transformation to the reconstructedimage to obtain the processed image.
 7. An image processing system forprocessing an image extracted from a document, the image processingsystem comprising: a processor; and a memory communicatively coupled tothe processor, wherein the memory stores processor-executableinstructions, which, on execution, causes the processor to performoperations comprising: detecting one or more edges of the image;determining a missing edge in the image by comparing color gradients ofthe one or more edges; computing a color gradient along each side of theimage; and comparing the color gradient of each side with remainingsides to detect the missing edge; reconstructing the missing edge bycloning image pixels based on data pixels of an edge, opposite to themissing edge, amongst the one or more edges to obtain a reconstructedimage, wherein the reconstructed image includes a reconstructed edge;identify outer corner points in the reconstructed image based onquadratic corner points, wherein the quadratic corner points aredetermined based on the one or more edges and the reconstructed edge;and performing an image perspective correction on the reconstructedimage, based on the outer corner points, to obtain a processed image. 8.The system as claimed in claim 7 wherein the instructions further causesthe processor to perform operations comprising: extracting at least oneunique feature from the processed image; comparing the at least oneunique feature with a trained data set to validate the processed image,wherein the trained data set comprises template images and predefinedfeatures set; and storing the processed image for future usage uponsuccessful validation.
 9. The system as claimed in claim 7, whereinoperations of reconstructing the missing edge further comprise:extending size of the image along the missing edge until a predeterminedoffset is reached to obtain an extended image; determining an emptyregion in the extended image by moving data pixels based on thepredetermined offset; and cloning the empty region, based on the datapixel of the edge opposite to the missing edge, to reconstruct themissing edge.
 10. The system as claimed in claim 9, wherein operationsof cloning the empty region further comprise: computing a colorvariation between background color and a color of the document; andapplying an edge gradient direction on cloned empty region, wherein theedge image gradient direction is determined based on the colorvariation.
 11. The system as claimed in claim 7, wherein operations ofidentifying the outer corner points further comprise: deriving thequadratic corner points by extending lines detected along the one ormore missing edge and the reconstructed edge; filtering redundantquadratic corner points amongst the quadratic corner points to obtain afiltered set of quadratic corner points; detecting outer corner pointsin the filtered set of quadratic corner points based on coordinates,along a vertical direction and a horizontal direction, corresponding toeach quadratic corner point present in the filtered set of quadraticcorner points; increasing an edge detection filter threshold value ofthe reconstructed image upon unsuccessful detection of all the outercorner points; and iterating detection of the outer corner points withthe increased edge detection filter threshold value till all the outercorner points are detected.
 12. The system as claimed in claim 7,wherein operations of performing the image perspective correction on thereconstructed image further comprise: performing polygon approximationon the outer corner points; determining a mass center of thereconstructed image based on the polygon approximation; computing aperspective transformation for the reconstructed image based on the masscenter and a predefined image size; and applying the perspectivetransformation to the reconstructed image to obtain the processed image.13. A non-transitory computer readable medium including instructionsstored thereon that when processed by at least one processor cause animage processing system to perform operations comprising: detecting oneor more edge of an image extracted from a document; determining amissing edge in the image by comparing color gradients of the one ormore edges; computing a color gradient along each side of the image; andcomparing the color gradient of each side with remaining sides to detectthe missing edge; reconstructing the missing edge by cloning imagepixels based on data pixels of an edge, opposite to the missing edge,amongst the one or more edges to obtain a reconstructed image, whereinthe reconstructed image includes a reconstructed edge; identify outercorner points in the reconstructed image based on quadratic cornerpoints, wherein the quadratic corner points are determined based on theone or more edges and the reconstructed edge; and performing an imageperspective correction on the reconstructed image, based on the outercorner points, to obtain a processed image.